package com.cdd.permission.controller;

import com.alibaba.nacos.api.naming.CommonParams;
import com.cdd.permission.service.PermissionService;
import com.common.entity.Permission;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Comparator;

/**
 * TODO
 *
 * @author lenovo
 * @version 1.0
 * @since 2022-08-31  19:03:48
 */
@RestController
@RequestMapping("/permission/permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;
    @RequestMapping("/leftPermission")
    public CommonResult leftpermission(HttpServletRequest request){
        //获取token
       String token = request.getHeader("token");
        return permissionService.selectPermission(token);
    }
}
